package com.studies.pc.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.studies.common.R.R;
import com.studies.pc.pojo.Activity;
import com.studies.pc.pojo.ActivityRecord;
import com.studies.pc.query.ActivityRecordQuery;
import com.studies.pc.service.ActivityRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 研学风采 前端控制器
 * </p>
 *
 * @author 研学活动后台
 * @since 2019-12-24
 */
@Api(tags="研学活动风采模块")
@CrossOrigin //跨域
@RestController
@RequestMapping("/pc/record")
public class ActivityRecordController {
    @Autowired
    private ActivityRecordService activityRecordService;
    @ApiOperation(value = "分页研学风采列表")
    @PostMapping(value = "selectRecordPage/{pageSize}/{pageSize}")
    public R selectPage(@ApiParam(name = "nowPage", value = "当前页码", required = true)
                        @PathVariable Long nowPage,
                        @ApiParam(name = "pageSize", value = "每页记录数", required = true)
        @PathVariable Long pageSize,
     @ApiParam(name = "activityRecordQuery", value = "条件", required = false)
                            @PathVariable ActivityRecordQuery activityRecordQuery){
        Page<ActivityRecord> pageParam = new Page<ActivityRecord>(nowPage, pageSize);
        Map<String, Object> map = activityRecordService.selectRecordPage(pageParam,activityRecordQuery);
        return  R.ok().data(map);
    }
}

